/**
* @file        vdr_config
* @brief       
* @version     1.0.0
* @author      Changlin.Jing 
* @date        2023/7/28 14:57
* @copyright   Copyright  2022 Langge Software Co., Ltd. All rights reserved.
*/
#ifndef LANGGE_VDR_VDR_CONFIG_H
#define LANGGE_VDR_VDR_CONFIG_H
#include <string>
#include "loc_types.h"
#include <map>
#include <vector>
BEGIN_SPACE_LANGE_VDR
enum OS_TYPE {
    Andriod = 0, //
    iOS = 1
};


/*******************************************************************
 * 传感器类型: 0:加速度；1：陀螺仪； 2：滤波重力, 3:磁力计， 4：GPS, 5：车速，5、REF,
 *******************************************************************/
enum SENSOR_TYPE {
    ACC = 0,
    GY,
    GF,
    MAG,
    GPS,
    CARSPD,
    MM,
    REF,
};
/*
 * 车平台型号：适配层使用
 */
enum class AutoModel {
    UNKNOW = 0,      //默认
    ZEEK001 = 1,     //极氪001 车型
    ZEEK009 = 2,     //极氪009 车型
};

class CommonConfig {
public:
    static void Init(const WorkState &workState);


    //IPHONE手机
    static const std::string SUPPORT_PHONE_TYPE_IPHONE;

    //缺省手机
    static const std::string SUPPORT_PHONE_TYPE_DEFAULT;

    static const std::string SUPPORT_CAR_TYPE_ZEEK;

    static const float IPHONE_VALID_RAW_GPS_ACCURACY;

    static const float IPHONE_INVALID_RAW_GPS_ACCURACY;

    static const int COORDINATOR_TYPE_02;
    static const int COORDINATOR_TYPE_84;

    static int64_t GPS_ACTIVATE_TIME_MS;

    static float IMU_DATA_RATE;

    static float *getEnableNewVdrFrame();

    static void setPlatformType(PlatformType platform_type);

    static PlatformType getPlatformType();

    static void setOutputRate(std::int64_t output_rate);

    static std::int64_t getOutputRate();

    static std::map<std::string, std::string> getVdrConfig();

    static std::string getLocalConfigDir();

    static float getLastStopHeading();

    static void setVdrConfig(const std::string &path);

    static int saveLocalConfigs(std::map<std::string, std::string> configMap, std::string savePath);

    static void setDRModePeriod(std::int64_t DRModePeriod);

    static std::int64_t getDRModePeriod();

    static AutoModel setAutoModel(AutoModel autoModel);

    static AutoModel getAutoModel();

    static std::vector<float> getMountAngle();

private:
    static int64_t OUTPUT_RATE;
    //VDR工作模式
    static WorkState mWorkState;

    static std::string mLocalConfigDir;

    static std::map<std::string, std::string> vdrOuterConfig;

    static float lastStopHeading;


    static int64_t EnableDRModePeriod;

    static AutoModel mAutoModel;

    static std::vector<float> mMountAngle;

};
END_SPACE_LANGE_VDR
#endif //LANGGE_VDR_VDR_CONFIG_H
